package cn.serenedream.housedecoration.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;

public class SaleProductsDTO {
    @NotNull(message = "所需产品不得为空")
    private Long productsId;
    @NotEmpty(message = "产品数量不得为空")
    private Integer number;
    @NotBlank(message = "销售产品总价不得为空")
    @Pattern(regexp = "\\d{0,}\\.\\d{2}", message = "金额格式不正确")
    private Double price;


    public SaleProductsDTO() {
    }

    public SaleProductsDTO(Long productsId, Integer number, Double price) {
        this.productsId = productsId;
        this.number = number;
        this.price = price;
    }

    /**
     * 获取
     * @return productsId
     */
    public Long getProductsId() {
        return productsId;
    }

    /**
     * 设置
     * @param productsId
     */
    public void setProductsId(Long productsId) {
        this.productsId = productsId;
    }

    /**
     * 获取
     * @return number
     */
    public Integer getNumber() {
        return number;
    }

    /**
     * 设置
     * @param number
     */
    public void setNumber(Integer number) {
        this.number = number;
    }

    /**
     * 获取
     * @return price
     */
    public Double getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(Double price) {
        this.price = price;
    }

    public String toString() {
        return "SaleProductsDTO{productsId = " + productsId + ", number = " + number + ", price = " + price + "}";
    }
}